package com.spvs.system.common;

import lombok.Getter;

import java.util.Arrays;

/**
 * @description:租赁状态枚举值
 * @authoer:jianghaijiao
 * @createDate:2024/6/19-10:01
 */

@Getter
public enum LeaseStateEnum {

    IN_RENT(1, "在租"),
    OUT_RENT(2, "退租"),
    STOP_RENT(3, "停租"),
    ADD_RENT(4, "续租");


    LeaseStateEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private Integer code;
    private String desc;

    public static LeaseStateEnum getByFormCode(Integer code) {
        return Arrays.stream(LeaseStateEnum.values())
                .filter(value -> value.getCode().equals(code))
                .findFirst().orElse(null);
    }
}
